package com.woniu.adminservice.service.impl;

import com.woniu.adminservice.entity.Log;
import com.woniu.adminservice.dao.LogDao;
import com.woniu.adminservice.service.LogService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service("logService")
public class LogServiceImpl implements LogService {
    @Resource
    private LogDao logDao;

    @Override
    public Log queryById(Integer id) {
        return logDao.queryById(id);
    }

    @Override
    public List<Log> queryAllByLimit(int offset, int limit) {
        return logDao.queryAllByLimit(offset, limit);
    }
   
     @Override
    public List<Log> findAll() {
        return logDao.findAll();
    }

    @Override
    public Log insert(Log log) {
        logDao.insert(log);
        return log;
    }

    @Override
    public Log update(Log log) {
        logDao.update(log);
        return queryById(log.getId());
    }

    @Override
    public boolean deleteById(Integer id) {
        return logDao.deleteById(id) > 0;
    }
}